-
Notifications
You must be signed in to change notification settings - Fork 11
chore: Pipe headers through data sources. #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| if (response.code() == 304) { | ||
| logger.debug("FDv2 polling request returned 304: not modified"); | ||
| future.complete(null); | ||
| future.complete(FDv2PayloadResponse.none(response.code())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having null indicate no transfer I made an explicit none.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| case CHANGESET: | ||
| FDv2ProtocolHandler.FDv2ActionChangeset changeset = (FDv2ProtocolHandler.FDv2ActionChangeset) action; | ||
| try { | ||
| // TODO: Environment ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fallback header lost in serialization error paths
Medium Severity
In handleMessage, when SerializationException or protocol handler exceptions occur, interruptedWithException(e, ...) is called which uses getFallback(Exception e). This method only extracts the fallback header from StreamHttpErrorException, returning false for all other exception types. However, the MessageEvent event variable is available and contains the headers. Other error paths in the same method correctly use getFallback(event) (lines 257, 267, 281, 305), but these two catch blocks lose the header information.
This pipes the fdv1 fallback header, and the environment ID, through the data sources. It doesn't utilize either piece of information.
This is draft while I sort publishing the okhttp-evensource.
Note
Introduces header propagation and response/result refactors for FDv2 data sources.
HeaderConstantsand plumbx-ld-fd-fallbackandx-ld-envidthrough polling/streaming; setfdv1FallbackonFDv2SourceResultand passenvironmentIdto change-set translationFDv2Requestor.FDv2PayloadResponseto includestatusCode/isSuccesswithsuccess/failure/nonefactories;DefaultFDv2Requestornow returns these (304 ->none, non-2xx ->failure)PollingBaseandStreamingSynchronizerImplto interpret new responses, treat HTTP errors without throwing, and emit results with fallback flag; extract env-id from headers/eventsFDv2SourceResultto carryfdv1Fallbackand new factory usages across codeokhttp-eventsource4.1.0 -> 4.2.0Written by Cursor Bugbot for commit b20c621. This will update automatically on new commits. Configure here.